<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="/favicon.ico" >
<LINK rel="Shortcut Icon" href="/favicon.ico" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="/luntanshequ/Public/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="/luntanshequ/Public/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="/luntanshequ/Public/css/style.css" rel="stylesheet" type="text/css" />
<link href="/luntanshequ/Public/lib/font-awesome/font-awesome.min.css" rel="stylesheet" type="text/css" />
<!--[if IE 7]>
<link href="lib/font-awesome/font-awesome-ie7.min.css" rel="stylesheet" type="text/css" />
<![endif]-->
<link href="/luntanshequ/Public/lib/iconfont/iconfont.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>管理员列表</title>
</head>
<body>
<nav class="breadcrumb"><i class="iconfont">&#xf012b;</i> 首页 <span class="c-gray en">&gt;</span> 管理员管理 <span class="c-gray en">&gt;</span> 管理员列表 <a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="icon-refresh"></i></a></nav>
<div class="pd-20">
  <div class="text-c">
    <form class="Huiform" method="post" action="<?php echo U('admin/admin/adminadd');?>" >
      <input type="text" placeholder="管理员名" autocomplete="off" name="adminname"  class="input-text" style=" width:150px">
      <input type="password" name="password" placeholder="密码" autocomplete="off"  class="input-text" style="width:150px;">
      <input type="password" placeholder="确认密码" name="repassword" autocomplete="off" value="" class="input-text" style="width:150px;">
      <span class="select-box" style="width:150px;">
      <select class="select" name="adminrole" size="1">
        <?php
 foreach ($CateRes as $key => $value) { ?>
              <option value="<?php echo ($value['id']); ?>"><?php echo ($value['title']); ?></option>
            <?php
 } ?>
      </select>
      </span>
      <button type="submit" class="btn btn-success" ><i class="icon-plus"></i> 添加</button>
    </form>
  </div>
  <div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l"><a href="javascript:;" onclick="datadel()" class="btn btn-danger radius"><i class="icon-trash"></i> 批量删除</a></span> <span class="r">共有数据：<strong><?php echo $count ?></strong> 条</span> </div>
  <table class="table table-border table-bordered table-bg">
    <thead>
      <tr>
        <th scope="col" colspan="7">员工列表</th>
      </tr>
      <tr class="text-c">
        <th width="25"><input type="checkbox" name="" value=""></th>
        <th width="40">ID</th>
        <th width="150">登录名</th>
        <th>角色</th>
        <th width="130">加入时间</th>
        <th width="100">是否已启用</th>
        <th width="70">操作</th>
      </tr>
    </thead>
    <tbody>
      <?php
 foreach ($result as $key => $value) { ?>
            <tr class="text-c">
              <td><input type="checkbox" value="<?php echo ($value['admin_id']); ?>" name=""></td>
              <td><?php echo ($value['admin_id']); ?></td>
              <td><?php echo ($value['admin_name']); ?></td>
              <td><?php echo ($value['managedesc']); ?></td>
              <td>2014-6-11 11:11:42</td>
              <?php
 if($value['admin_status'] == 1){ ?>
                     <td class="admin-status"><span class="label label-success radius">已启用</span></td>
                  <?php
 }elseif($value['admin_status'] == -1){ ?>
                     <td class="admin-status"><span class="label  radius">已停用</span></td>
                  <?php  } ?>
              
              <td class="f-14 admin-manage">
                <?php
 if($value['admin_status'] == 1){ ?>
                      <a style="text-decoration:none" onClick="admin_stops(this,<?php echo ($value['admin_id']); ?>)" href="javascript:;" title="停用">
                        <i class="icon-hand-down"></i>
                      </a> 
                    <?php
 }else{ ?>
                      <a style="text-decoration:none" onClick="admin_starts(this,<?php echo ($value['admin_id']); ?>)" href="javascript:;" title="启用">
                        <i class="icon-hand-up"></i>
                      </a> 
                    <?php
 } ?>
                <a title="编辑" href="javascript:;" onclick="this.href='<?php echo U('admin/admin/adminedit',array('adminid'=>$value['admin_id']));?>'" class="ml-5" style="text-decoration:none"><i class="icon-edit"></i></a> <a title="删除" href="javascript:;" onclick="if(confirm('您是否真的要删除')){this.href='<?php echo U('admin/admin/adminnitratordelete',array('id'=>$value['admin_id']));?>'}" class="ml-5" style="text-decoration:none"><i class="icon-trash"></i></a></td>
            </tr>
          <?php  } ?>
    </tbody>
  </table>
</div>
<script type="text/javascript" src="/luntanshequ/Public/lib/jquery.min.js"></script> 
<script type="text/javascript" src="/luntanshequ/Public/lib/Validform_v5.3.2.js"></script> 
<script type="text/javascript" src="/luntanshequ/Public/lib/layer1.8/layer.min.js"></script> 
<script type="text/javascript" src="/luntanshequ/Public/lib/laypage/laypage.js"></script> 
<script type="text/javascript" src="/luntanshequ/Public/js/H-ui.js"></script> 
<script type="text/javascript" src="/luntanshequ/Public/js/H-ui.admin.js"></script> 
<script type="text/javascript" src="/luntanshequ/Public/js/H-ui.admin.doc.js"></script> 
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?080836300300be57b7f34f4b3e97d911";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F080836300300be57b7f34f4b3e97d911' type='text/javascript'%3E%3C/script%3E"));

/*管理员-停用*/
function admin_stops(obj,id){
  var thisObj = $(obj);
  var theid = id;
  $.ajax({
    url: '<?php echo U("admin/admin/adminstop");?>',
    type: 'POST',
    dataType: 'json',
    data: {thisid: theid},
    success:function(data){
      thisObj.parents("tr").find(".admin-manage").prepend('<a style="text-decoration:none" onClick="admin_stops(this,'+theid+')" href="javascript:;" title="停用"><i class="icon-hand-down"></i></a>');
      thisObj.parents("tr").find(".admin-status").html('<span class="label label-success radius">已启用</span>');
      thisObj.remove();
    }
  })
  
  $(obj).parents("tr").find(".admin-manage").prepend('<a style="text-decoration:none" onClick="admin_starts(this,'+theid+')" href="javascript:;" title="启用"><i class="icon-hand-up"></i></a>');
  $(obj).parents("tr").find(".admin-status").html('<span class="label radius">已停用</span>');
  $(obj).remove();
}

/*管理员-启用*/
function admin_starts(obj,id){
  var thisObj = $(obj);
  var theid = id;
  $.ajax({
    url: '<?php echo U("admin/admin/adminup");?>',
    type: 'POST',
    dataType: 'json',
    data: {thisid: theid},
    success:function(data){
      thisObj.parents("tr").find(".admin-manage").prepend('<a style="text-decoration:none" onClick="admin_stops(this,'+theid+')" href="javascript:;" title="停用"><i class="icon-hand-down"></i></a>');
      thisObj.parents("tr").find(".admin-status").html('<span class="label label-success radius">已启用</span>');
      thisObj.remove();
    }
  })
  
  
}



</script>
</body>
</html>